package com.team.abs.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.team.abs.service.*;

import net.sf.json.JSONObject;
@Controller
public class manager_login_controller {
	@Autowired
	private manager_login_service manager_login_service;
	//管理员登录 后续发现用一个类 太奢侈了
	@ResponseBody
	@RequestMapping(value="/manager_login_api",method=RequestMethod.POST)
	public String manager_login_api(
			@RequestParam(value="user_uid",required=true)String user_uid,
			@RequestParam(value="user_password",required=true)String user_password){
		JSONObject result=new JSONObject();
		if(manager_login_service.manager_login(user_uid, user_password)!=0)
		result.put("status", "success");
		else result.put("status", "fail");

		return result.toString();
	} 
}
